package com.caochenlei.array;

public class VariableArrayTest {
    public static void main(String[] args) {
        VariableArray<String> va = new VariableArray<>(4);

        va.add("张三");
        va.add("李四");
        va.add("王五");
        va.add("赵六");

        System.out.println("====================");
        for (int i = 0; i < va.size(); i++) {
            System.out.println(va.get(i));
        }
        System.out.println("====================");
        System.out.println(va.indexOf("张三"));
        System.out.println(va.indexOf("李四"));
        System.out.println(va.indexOf("王五"));
        System.out.println(va.indexOf("赵六"));
        System.out.println("====================");
        System.out.println(va.lastIndexOf("张三"));
        System.out.println(va.lastIndexOf("李四"));
        System.out.println(va.lastIndexOf("王五"));
        System.out.println(va.lastIndexOf("赵六"));
        System.out.println("====================");
        va.remove(3);
        va.remove(2);
        va.remove(1);
        va.remove(0);
        System.out.println(va.size());
    }
}
